<template>
  <van-search
    v-model="value"
    shape="round"
    background="#f66"
    placeholder="请输入搜索关键词"
    show-action
    @focus="goPage"
  >
  <template #label>
    <div class="label">
      <img src="../assets/logo.png" class="logo" ><div class="split"></div>
    </div>    
  </template>
  <template #left>
    <div class="login" @click="getCity">西安</div>
  </template>
  <template #action>
    <div class="login" @click="goLogin">登录</div>
  </template>
  </van-search>
</template>

<script>


export default {
  name: "Search",
  data() {
    return {
      value: "",
    };
  },
  methods: {
    getCity() {
      console.log("获取城市数据");
    },
    onSearch() {},
    goLogin(){
      console.log("去登录");
    },
    goPage(){
      console.log("去搜索页面");
    }
  },
};
</script>

<style lang="less" scoped>

@w:10px;

@search-input-height:50px;


.login{
  color:white;
}

.label{
  display: flex;  
  align-items: center;
  /* border: 1px solid black; */
  height: 100%;
}
.logo{
  /* display:block; */
  width: 2.5rem;
  height: 24px;
}
.split{
  width: @w;
  height:25px;
  border-right:2px solid gray;
}
</style>